from app.services.business.gaolu_diagnose.ind.abstract_ind import AbstractInd


class CG_LT_GL_GL04_Coke_Greater40mm(AbstractInd):

    def get_name(self):
        return "CG_LT_GL_GL04_Coke_Greater40mm"

    def get_data_source(self):
        return "mysql"

    def get_db(self):
        return "ironman"

    def get_sql(self, params):

        sql = """
        SELECT
        round(AVG(CG_LT_GL_GL04_Yuanranliao_Coke_Greater40mm),0) as  CG_LT_GL_GL04_Coke_Greater40mm
        FROM cg_lt_gl04_hanfan_predict
        WHERE DateTime > DATE_SUB(CURTIME(), INTERVAL 2 hour)
        """.format(**params)
        return sql
